package com.fancy.learncenter.ui.adapter;

import android.content.Context;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.fancy.learncenter.R;
import com.fancy.learncenter.ui.adapter.base.CommonRecycleViewAdapter;
import com.fancy.learncenter.ui.adapter.base.CustomViewHold;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Hyy on 2017/1/12.
 */

public class ActivityActPartyAdapter extends CommonRecycleViewAdapter<String> {
    Context mContext;

    public ActivityActPartyAdapter(Context mContext, List<String> itemDatas) {
        super(mContext, R.layout.activity_act_party_item, itemDatas);
        this.mContext = mContext;
    }

    @Override
    public void bindView(CustomViewHold customViewHold, String item, int position) {
        RecyclerView recyclerView = customViewHold.getView(R.id.recyclerView);
        ArrayList<String> datas = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            datas.add("" + i);
        }

        initRecycleView(recyclerView);
        recyclerView.setAdapter(new MAdapter(mContext, datas));
    }

    class MAdapter extends CommonRecycleViewAdapter<String> {

        public MAdapter(Context mContext, List<String> itemDatas) {
            super(mContext, R.layout.activity_act_party_item2, itemDatas);
        }

        @Override
        public void bindView(CustomViewHold customViewHold, String item, int position) {

        }
    }

    private void initRecycleView(RecyclerView recyclerView) {
        LinearLayoutManager manager = new LinearLayoutManager(mContext);
        manager.setOrientation(LinearLayoutManager.HORIZONTAL);
        recyclerView.setLayoutManager(manager);
    }
}
